Skip to content

Fix reference.ts producing empty hugo.json#1957

Merged
cderv merged 1 commit into
mainfrom
fix/hugo-json-empty
Mar 10, 2026
Merged

Fix reference.ts producing empty hugo.json#1957
cderv merged 1 commit into
mainfrom
fix/hugo-json-empty

Conversation

@cderv
Copy link
Copy Markdown
Member

@cderv cderv commented Mar 10, 2026

The update-prerelease-reference.yml workflow runs tools/reference.ts to regenerate format reference JSON files. For hugo.qmd, this produces an empty [] because "hugo" is not in pandoc-all — it's a custom Quarto format based on GFM, not a Pandoc built-in.

Fix

Map hugo to its base format gfm for option lookup, so hugo.json gets the correct GFM options. The output filename stays hugo.json. Also add a guard that warns and skips any format with no pandoc-all match, preventing silent empty output for unknown formats.

Upstream fix requested in quarto-dev/quarto-cli#14191 to add hugo-md to pandoc-all as a synthesized format (like dashboard), after which this workaround can be removed.

Fixes #1951

Hugo is a custom Quarto format not in pandoc-all, so
optionsForFormat("hugo") matches no options and writes [].

Map "hugo" to its base format "gfm" for option lookup while
keeping the output filename as hugo.json. Also add a guard
that warns and skips formats with no pandoc-all match.
@github-actions github-actions Bot temporarily deployed to pull request March 10, 2026 17:05 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

📝 Preview Deployment

🔍 Full site preview: https://deploy-preview-1957.quarto.org

@cderv cderv merged commit 3468104 into main Mar 10, 2026
4 checks passed
@cderv cderv deleted the fix/hugo-json-empty branch March 10, 2026 17:06
github-actions Bot pushed a commit that referenced this pull request Mar 10, 2026
Hugo is a custom Quarto format not in pandoc-all, so
optionsForFormat("hugo") matches no options and writes [].

Map "hugo" to its base format "gfm" for option lookup while
keeping the output filename as hugo.json. Also add a guard
that warns and skips formats with no pandoc-all match.

(cherry picked from commit 3468104)
@github-actions
Copy link
Copy Markdown
Contributor

Successfully created backport PR for prerelease:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant